package com.demo.spring_demo.mapper;

import com.demo.spring_demo.pojo.PageInfo;
import com.demo.spring_demo.pojo.PlayList;
import com.demo.spring_demo.pojo.Song;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Mapper
@ResponseBody
public interface PlayListMapper {

    /**
     * 1、分页查询
     * 1、查询到的总条数
     * 2、查询到的数据
     * //
     */
    int getCount(@Param("playlist") PlayList playlist);

    List<PlayList> getPlayList(@Param("playlist")PlayList playList, @Param("index") int index, @Param("size") int size);

    @Delete("delete from playlists where playlistid=#{playListId}")
    int deletePlayList(int playlistId);
}
